<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const objArr = [
      {a: 1, b: 2},
      {a: 2, b: 3},
      {a: 1, b: 2},
      {a: 2, b: 4},
      {a: 1, b: 2, c: 3,},
      {a: 1, b: 2, c: 3, d:4},
      {a: 1, b: 2, c: 5, d:4},
      {a: 1, b: 2, c: 3, d:4},
    ]
    // const objArr = [ 1,2,4,5,4,2,2,5,6,6,2,2,34,5]
    function isObject(val) {
      return typeof val === 'object' && val !== null
    }

    const isEqual = (v1, v2)=> {
      if(!isObject(v1) || !isObject(v2)){
        return v1 === v2
      }
      const keys1 = Object.keys(v1)
      const keys2 = Object.keys(v2)
      if(keys1.length !== keys2.length) return false
      for(let i=0; i< keys1.length; i++) {        
        const key1 = keys1[i]
        const key2 = keys2[i]
        if(key1 !== key2) return false
        if(isEqual(v1[key1], v2[key2])) {
          continue
        }else{
          return false
        }
      }
      return true
    }
    
    function delReapt(arr) {
      const newArr = []
      for(let i=0; i< arr.length; i++) {
        const exits = newArr.find((item)=> isEqual(item, arr[i]))
        if(!exits) {
          newArr.push(arr[i])
        }
      }
      return newArr
    }
    console.log(delReapt(objArr))
  </script>
</body>
</html>